wayland: Remove old "gdk-attached-grab-surface" hackery
authorJonas Ådahl <jadahl@gmail.com>
Mon, 10 Feb 2020 08:56:18 +0000 (09:56 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Wed, 19 Feb 2020 08:47:18 +0000 (09:47 +0100)
The corresponding code in gtk/ is long gone, so it's luckly unused these
days.

gdk/wayland/gdksurface-wayland.c

index 55134b1409adadfc5638531aa57105a13075b381..20198e74943f5d775cb8e662e0e1e5d5b7375536 100644 (file)
@@ -2297,7 +2297,6 @@ static GdkWaylandSeat *
 find_grab_input_seat (GdkSurface *surface,
                       GdkSurface *transient_for)
 {
-  GdkSurface *attached_grab_surface;
   GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
   GdkWaylandSurface *tmp_impl;
 
@@ -2308,20 +2307,6 @@ find_grab_input_seat (GdkSurface *surface,
   if (impl->grab_input_seat)
     return GDK_WAYLAND_SEAT (impl->grab_input_seat);
 
-  /* HACK: GtkMenu grabs a special surface known as the "grab transfer surface"
-   * and then transfers the grab over to the correct surface later. Look for
-   * this surface when taking the grab to know it's correct.
-   *
-   * See: associate_menu_grab_transfer_surface in gtkmenu.c
-   */
-  attached_grab_surface = g_object_get_data (G_OBJECT (surface), "gdk-attached-grab-surface");
-  if (attached_grab_surface)
-    {
-      tmp_impl = GDK_WAYLAND_SURFACE (attached_grab_surface);
-      if (tmp_impl->grab_input_seat)
-        return GDK_WAYLAND_SEAT (tmp_impl->grab_input_seat);
-    }
-
   while (transient_for)
     {
       tmp_impl = GDK_WAYLAND_SURFACE (transient_for);
@@ -2437,27 +2422,7 @@ gdk_wayland_surface_map (GdkSurface *surface)
         {
           GdkDevice *grab_device = NULL;
 
-          /* The popup menu surface is not the grabbed surface. This may mean
-           * that a "transfer surface" (see gtkmenu.c) is used, and we need
-           * to find that surface to get the grab device. If so is the case
-           * the "transfer surface" can be retrieved via the
-           * "gdk-attached-grab-surface" associated data field.
-           */
-          if (!impl->grab_input_seat)
-            {
-              GdkSurface *attached_grab_surface =
-                g_object_get_data (G_OBJECT (surface),
-                                   "gdk-attached-grab-surface");
-              if (attached_grab_surface)
-                {
-                  GdkWaylandSurface *attached_impl =
-                    GDK_WAYLAND_SURFACE (attached_grab_surface);
-                  grab_device = gdk_seat_get_pointer (attached_impl->grab_input_seat);
-                  transient_for =
-                    gdk_device_get_surface_at_position (grab_device, NULL, NULL);
-                }
-            }
-          else
+          if (impl->grab_input_seat)
             {
               grab_device = gdk_seat_get_pointer (impl->grab_input_seat);
               transient_for =